package com.woniu.common.utils.messageUtil;

import com.aliyun.dysmsapi20170525.Client;
import com.aliyun.teaopenapi.models.Config;

// 创建客户端。初始化操作

public class ClientFactory {

    public static final String ALIBABA_CLOUD_ACCESS_KEY_ID = "LTAI5tQV743PBWPSZnpi8eQi";
    public static final String ALIBABA_CLOUD_ACCESS_KEY_SECRET = "ahdYB2rzCGEzSQdilBNxzvST71Nnxl";

    public static Client createClient() throws Exception {
        Config config = new Config()
                // 配置 AccessKey ID，请确保代码运行环境配置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。
                .setAccessKeyId(ALIBABA_CLOUD_ACCESS_KEY_ID)//id
                // 配置 AccessKey Secret，请确保代码运行环境配置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。
                .setAccessKeySecret(ALIBABA_CLOUD_ACCESS_KEY_SECRET);//密码

        // 配置 Endpoint
        config.endpoint = "dysmsapi.aliyuncs.com";

        return new Client(config);
    }
}